<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/4/12 0012
 * Time: 下午 3:55
 */

namespace ServiceClass;

use Illuminate\Support\Facades\DB;
use ServiceClassInterface\AboutContract;

class About implements AboutContract
{
    public function getAbout()
    {
        $aboutData = DB::table('about')->where('about_id','=','1')->get();


        if($aboutData){
            return $aboutData;
        }else{
            return 0;
        }
    }

    public function updateAbout($aboutData,$aboutShortContent)
    {
        $result = DB::table('about')->where('about_id','=','1')->update(['about_text' => $aboutData,
            'about_CreateTime' => date('Y-m-d'),'about_shortContent' => $aboutShortContent]);


        if($result){
            return 1;
        }else{
            return 0;
        }
    }
}